package org.footballmanager.pandafootball.common.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * @author chenjian
 * @since 2017年10月18日下午5:17:22
 */
public class Constants {
    /* page */
    public static final String PI = "pi";
    /* 逗号 */
    public static final String COMMA = ",";
    /* 主键 */
    public static final String ID = "id";
    /* OK */
    public static final String OK = "ok";
    /* 错误 */
    public static final String ERROR = "error";
    /* 管理员 */
    public static final String ADMIN = "admin";
    /* 用户 */
    public static final String USER = "footUser";
    /* 友情提示 */
    public static final String YQTS = "footYqts";
    /* 验证码 */
    public static final String YZM = "yzm";
    /* logo */
    public static final String LOGO = "logo";
    /* slt */
    public static final String SLT = "slt";
    /* Session里的用户主键 */
    public static final String USERID = "userId";
    /* 成功 */
    public static final String SUCCESS = "success";
    /* 消息 */
    public static final String MSG = "msg";
    /* 代码 */
    public static final String CODE = "code";
    /* foot开头返回后台 */
    public static final String FOOT = "foot";
    /* hy开头返回前台 */
    public static final String HY = "hy";
    /* 查询条件名称 */
    public static final String FORMNAME = "%sSearchForm";
    /* 列表名称 */
    public static final String LISTENTITY = "%sList";
    /* 列表页面 */
    public static final String LISTPAGE = "%s/%s/List";
    /* 重定向页面 */
    public static final String REDIRECT = "redirect:/%s/%s/search";
    /* 添加页面 */
    public static final String ADDPAGE = "%s/%s/Add";
    /* 编辑页面 */
    public static final String EDITPAGE = "%s/%s/Edit";
    /* 查看页面 */
    public static final String VIEWPAGE = "%s/%s/View";
    /* 错误提示 */
    public static final String MISFORMAT = "misFormat";

    public static final String PERSONTABLE = "foot_person";

    private Constants() {
    }

    /**
     * 根据表名获取对应的excel表头
     *
     * @param tableName 参数
     * @return 返回值
     */
    public static Map<String, String> getMap(String tableName) {
        Map<String, String> map = new HashMap<>();
        if ("houseInfo".equals(tableName)) {
            map.put("序号", Constants.ID);
            map.put("房屋名称", "houseName");
            map.put("室数量", "roomNumber");
            map.put("厅数量", "drawingNumber");
            map.put("厨数量", "kitchenNumber");
            map.put("卫数量", "restroomNumber");
            map.put("朝向", "orientation");
            map.put("房屋面积", "houseArea");
            map.put("所在楼层", "layer");
            map.put("总楼层", "totalLayer");
            map.put("所在小区", "polt");
            map.put("详细地址", "address");
            map.put("所在省", "province");
            map.put("所在市", "city");
            map.put("所在区", "region");
            map.put("住宅用途", "purpose");
            map.put("购买时间", "buyTime");
            map.put("产权", "propertyRight");
            map.put("类型", "type");
        }
        return map;
    }

}
